package com.android.lovely.aav.discount

import com.android.lovely.api.service.UserService
import com.android.lovely.data.Preferential
import com.android.lovely.user.UserManager

class DiscountInfoManager(
    private val userService: UserService,
    private val userManager: UserManager
) {
    var discountInfo: Preferential? = null
        private set

    suspend fun fetchDiscountInfo(): Preferential? {
        if (!userManager.isLogin()) return null
        return userService.getDiscountInfo().also { discountInfo = it }
    }
}